using Microsoft.Phone.Controls.Primitives;
using System;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	internal abstract class LoopingDataSourceBase : ILoopingSelectorDataSource
	{
		public object AAAbbb;
		private object selectedItem;
		public event EventHandler<SelectionChangedEventArgs> SelectionChanged;
		public object SelectedItem
		{
			get
			{
				return this.selectedItem;
			}
			set
			{
				if (!object.Equals(this.selectedItem, value))
				{
					object oldSelectedItem = this.selectedItem;
					this.selectedItem = value;
					this.OnSelectionChanged(oldSelectedItem, this.selectedItem);
				}
			}
		}
		public abstract object GetNext(object relativeTo);
		public abstract object GetPrevious(object relativeTo);
		protected virtual void OnSelectionChanged(object oldSelectedItem, object newSelectedItem)
		{
			EventHandler<SelectionChangedEventArgs> selectionChanged = this.SelectionChanged;
			if (selectionChanged != null)
			{
				selectionChanged.Invoke(this, new SelectionChangedEventArgs(new object[]
				{
					oldSelectedItem
				}, new object[]
				{
					newSelectedItem
				}));
			}
		}
	}
}
